package com.gaofei.sysmanager.common;

import lombok.Data;

import java.io.Serializable;

@Data
//@ApiModel("基础响应对象")
@SuppressWarnings("serial")
public class ResponseVo<T> implements Serializable {

	private boolean success = true;

//	@ApiModelProperty("错误类型")
	private String errorCode = "";

//	@ApiModelProperty("错误信息")
	private String errorMessage = "";

//	@ApiModelProperty("返回数据")
	private T data;

	/** 创建默认为成功且无返回数据的响应信息 */
	public ResponseVo() {
	}

	/** 创建默认为成功且有返回数据的响应信息 */
	public ResponseVo(T data) {
		this.data = data;
	}

	public ResponseVo(boolean success, String errorCode, String errorMessage) {
		this.success = success;
		this.errorCode = errorCode;
		this.errorMessage = errorMessage;
	}

	public ResponseVo(boolean success, String errorCode, String errorMessage, T data) {
		this.success = success;
		this.errorCode = errorCode;
		this.errorMessage = errorMessage;
		this.data = data;
	}

}
